2000W / 48V LLC Battery-Charger  V1.00
xmc_can.c
Go to the documentation of this file.
1 
71 /*******************************************************************************
72  * HEADER FILES
73  *******************************************************************************/
74 #include "xmc_can.h"
75 
76 #if defined(CAN)
77 #include "xmc_scu.h"
78 
79 __STATIC_INLINE uint32_t max(uint32_t a, uint32_t b)
80 {
81  return (a > b) ? a : b;
82 }
83 
84 __STATIC_INLINE uint32_t min(uint32_t a, uint32_t b)
85 {
86  return (a < b) ? a : b;
87 }
88 
89 /*******************************************************************************
90  * API IMPLEMENTATION
91  *******************************************************************************/
92 
93 /* The max prescaler is the equal to max BRP setting (64) multiply by 8 (DIV8) */
94 #define XMC_CAN_NODE_MAX_PRESCALER 512
95 
96 /* maximum TSEG1 is 16 and maximum TSEG2 is 8, plus one fix sync tq */
97 #define XMC_CAN_NODE_MAX_NTQ 25
98 #define XMC_CAN_NODE_MIN_NTQ 8
99 
100 #define XMC_CAN_NODE_MIN_TSEG1 3
101 #define XMC_CAN_NODE_MIN_TSEG2 2
102 
103 int32_t XMC_CAN_NODE_NominalBitTimeConfigureEx(XMC_CAN_NODE_t *const can_node,
104  const XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t *const bit_time_config)
105 {
106  /* Check that the CAN frequency is a multiple of the required baudrate */
107  if ((bit_time_config->can_frequency % bit_time_config->baudrate) == 0)
108  {
109  uint32_t prescaler;
110  uint32_t div8 = 0;
111 
112  /* Calculate the factor between can frequency and required baudrate, this is equal to (prescaler x ntq) */
113  uint32_t fcan_div = bit_time_config->can_frequency / bit_time_config->baudrate;
114 
115  /* start with highest ntq, i.e as much as possible time quanta should be used to construct a bit time */
116  uint32_t ntq = XMC_CAN_NODE_MAX_NTQ;
117  while (ntq >= XMC_CAN_NODE_MIN_NTQ)
118  {
119  /* consider this ntq, only if fcan_div is multiple of ntq */
120  if ((fcan_div % ntq) == 0)
121  {
122  prescaler = fcan_div / ntq;
123  if ((prescaler > 0) && (prescaler <= XMC_CAN_NODE_MAX_PRESCALER))
124  {
125  if (prescaler >= 64)
126  {
127  /* consider prescaler >=64, if it is integer divisible by 8*/
128  if ((prescaler & 0x7U) == 0)
129  {
130  div8 = 1;
131  break;
132  }
133  }
134  else
135  {
136  break;
137  }
138  }
139  }
140  --ntq;
141  }
142 
143  if (ntq >= XMC_CAN_NODE_MIN_NTQ)
144  {
145  uint32_t tseg1 = ((ntq - 1) * bit_time_config->sample_point) / 1000;
146  uint32_t tseg2 = ntq - tseg1 - 1;
147 
148  if ((tseg1 < XMC_CAN_NODE_MIN_TSEG1) || (tseg2 < XMC_CAN_NODE_MIN_TSEG2) || (tseg2 < bit_time_config->sjw))
149  {
150  return XMC_CAN_STATUS_ERROR;
151  }
152 
153  XMC_CAN_NODE_EnableConfigurationChange(can_node);
154 
155  /* Configure bit timing register */
156  can_node->NBTR = (((tseg2 - 1u) << CAN_NODE_NBTR_TSEG2_Pos) & (uint32_t)CAN_NODE_NBTR_TSEG2_Msk) |
157  (((bit_time_config->sjw - 1U) << CAN_NODE_NBTR_SJW_Pos) & (uint32_t)CAN_NODE_NBTR_SJW_Msk) |
158  (((tseg1 - 1U) << CAN_NODE_NBTR_TSEG1_Pos) & (uint32_t)CAN_NODE_NBTR_TSEG1_Msk) |
159  (((prescaler - 1U) << CAN_NODE_NBTR_BRP_Pos) & (uint32_t)CAN_NODE_NBTR_BRP_Msk) |
160  ((div8 << CAN_NODE_NBTR_DIV8_Pos) & (uint32_t)CAN_NODE_NBTR_DIV8_Msk);
161 
162  XMC_CAN_NODE_DisableConfigurationChange(can_node);
163 
164  return XMC_CAN_STATUS_SUCCESS;
165  }
166  }
167 
168  return XMC_CAN_STATUS_ERROR;
169 }
170 
171 /* Baudrate Configuration */
172 void XMC_CAN_NODE_NominalBitTimeConfigure (XMC_CAN_NODE_t *const can_node,
173  const XMC_CAN_NODE_NOMINAL_BIT_TIME_CONFIG_t *const can_bit_time)
174 {
175  uint32_t temp_brp = 12U ;
176  uint32_t temp_tseg1 = 12U;
177  uint32_t best_brp = 0U;
178  uint32_t best_tseg1 = 1U;
179  uint32_t best_tseg2 = 0U;
180  uint32_t best_tbaud = 0U;
181  uint32_t best_error = 10000U;
182 
183  XMC_ASSERT("XMC_CAN_NODE_NOMINAL_BIT_TIME_Configure: rate not supported", (can_bit_time->baudrate < 1000000U) ||
184  (can_bit_time->baudrate >= 100000U));
185  XMC_ASSERT("XMC_CAN_NODE_NOMINAL_BIT_TIME_Configure: fCAN not supported",
186  can_bit_time->can_frequency <= 120000000U);
187  XMC_ASSERT("XMC_CAN_NODE_NOMINAL_BIT_TIME_Configure: fCAN not supported",
188  can_bit_time->can_frequency > 5000000U);
189  XMC_ASSERT("XMC_CAN_NODE_NOMINAL_BIT_TIME_Configure: sample point not supported",
190  (can_bit_time->sample_point < 10000U) && ((can_bit_time->sample_point > 0U)));
191 
192  /*
193  * Bit timing & sampling
194  * Tq = (BRP+1)/Fcan if DIV8 = 0
195  * Tq = 8*(BRP+1)/Fcan if DIV8 = 1
196  * TSync = 1.Tq
197  * TSeg1 = (TSEG1+1)*Tq >= 3Tq
198  * TSeg2 = (TSEG2+1)*Tq >= 2Tq
199  * Bit Time = TSync + TSeg1 + TSeg2 >= 8Tq
200  *
201  * Resynchronization:
202  *
203  * Tsjw = (SJW + 1)*Tq
204  * TSeg1 >= Tsjw + Tprop
205  * TSeg2 >= Tsjw
206  */
207  /* search for best baudrate */
208  for (temp_brp = 1U; temp_brp <= 64U; temp_brp++)
209  {
210 
211  uint32_t f_quanta = (uint32_t)((can_bit_time->can_frequency * 10U) / temp_brp);
212  uint32_t temp_tbaud = (uint32_t)(f_quanta / (can_bit_time->baudrate));
213  uint32_t temp_baudrate;
214  uint32_t error;
215 
216  if((temp_tbaud % 10U) > 5U)
217  {
218  temp_tbaud = (uint32_t)(temp_tbaud / 10U);
219  temp_tbaud++;
220  }
221  else
222  {
223  temp_tbaud = (uint32_t)(temp_tbaud / 10U);
224  }
225 
226  if(temp_tbaud > 0U)
227  {
228  temp_baudrate = (uint32_t) (f_quanta / (temp_tbaud * 10U));
229  }
230  else
231  {
232  temp_baudrate = f_quanta / 10U;
233  temp_tbaud = 1;
234  }
235 
236  if(temp_baudrate >= can_bit_time->baudrate)
237  {
238  error = temp_baudrate - can_bit_time->baudrate;
239  }
240  else
241  {
242  error = can_bit_time->baudrate - temp_baudrate;
243  }
244 
245  if ((temp_tbaud <= 20U) && (best_error > error))
246  {
247  best_brp = temp_brp;
248  best_tbaud = temp_tbaud;
249  best_error = (error);
250 
251  if (error < 1000U)
252  {
253  break;
254  }
255  }
256  }
257  /* search for best sample point */
258  best_error = 10000U;
259 
260  for (temp_tseg1 = 64U; temp_tseg1 >= 3U; temp_tseg1--)
261  {
262  uint32_t tempSamplePoint = ((temp_tseg1 + 1U) * 10000U) / best_tbaud;
263  uint32_t error;
264  if (tempSamplePoint >= can_bit_time->sample_point)
265  {
266  error = tempSamplePoint - can_bit_time->sample_point;
267  }
268  else
269  {
270  error = can_bit_time->sample_point - tempSamplePoint;
271  }
272  if (best_error > error)
273  {
274  best_tseg1 = temp_tseg1;
275  best_error = error;
276  }
277  if (tempSamplePoint < (can_bit_time->sample_point))
278  {
279  break;
280  }
281  }
282 
283  best_tseg2 = best_tbaud - best_tseg1 - 1U;
284 
285  XMC_CAN_NODE_EnableConfigurationChange(can_node);
286  /* Configure bit timing register */
287  can_node->NBTR = (((uint32_t)(best_tseg2 - 1u) << CAN_NODE_NBTR_TSEG2_Pos) & (uint32_t)CAN_NODE_NBTR_TSEG2_Msk) |
288  ((((uint32_t)((uint32_t)(can_bit_time->sjw)-1U) << CAN_NODE_NBTR_SJW_Pos)) & (uint32_t)CAN_NODE_NBTR_SJW_Msk)|
289  (((uint32_t)(best_tseg1-1U) << CAN_NODE_NBTR_TSEG1_Pos) & (uint32_t)CAN_NODE_NBTR_TSEG1_Msk)|
290  (((uint32_t)(best_brp - 1U) << CAN_NODE_NBTR_BRP_Pos) & (uint32_t)CAN_NODE_NBTR_BRP_Msk)|
291  (((uint32_t)0U << CAN_NODE_NBTR_DIV8_Pos) & (uint32_t)CAN_NODE_NBTR_DIV8_Msk);
292  XMC_CAN_NODE_DisableConfigurationChange(can_node);
293 }
294 /* Function to allocate message object from free list to node list */
295 void XMC_CAN_AllocateMOtoNodeList(XMC_CAN_t *const obj, const uint8_t node_num, const uint8_t mo_num)
296 {
297  /* wait while panel operation is in progress. */
298  while (XMC_CAN_IsPanelControlReady(obj) == false)
299  {
300  /*Do nothing*/
301  };
302 
303  /* Panel Command for allocation of MO to node list */
304  XMC_CAN_PanelControl(obj, XMC_CAN_PANCMD_STATIC_ALLOCATE,mo_num,(node_num + 1U));
305 }
306 
307 /* Disable XMC_CAN Peripheral */
308 void XMC_CAN_Disable(XMC_CAN_t *const obj)
309 {
310  /* Disable CAN Module */
311  obj->CLC = CAN_CLC_DISR_Msk;
312 #if defined(PERIPHERAL_RESET_SUPPORTED)
313  XMC_SCU_RESET_AssertPeripheralReset(XMC_SCU_PERIPHERAL_RESET_MCAN);
314 #endif
315 #if defined(CLOCK_GATING_SUPPORTED)
316  XMC_SCU_CLOCK_GatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_MCAN);
317 #endif
318 }
319 
320 /* Enable XMC_CAN Peripheral */
321 void XMC_CAN_Enable(XMC_CAN_t *const obj)
322 {
323 #if defined(CLOCK_GATING_SUPPORTED)
324  XMC_SCU_CLOCK_UngatePeripheralClock(XMC_SCU_PERIPHERAL_CLOCK_MCAN);
325 #endif
326 #if defined(PERIPHERAL_RESET_SUPPORTED)
327  XMC_SCU_RESET_DeassertPeripheralReset(XMC_SCU_PERIPHERAL_RESET_MCAN);
328 #endif
329  /* Enable CAN Module */
330  obj->CLC &= ~(uint32_t)CAN_CLC_DISR_Msk;
331  while (obj->CLC & CAN_CLC_DISS_Msk)
332  {
333  /*Do nothing*/
334  };
335 }
336 
337 #if defined(MULTICAN_PLUS)
338 void XMC_CAN_Init(XMC_CAN_t *const obj, XMC_CAN_CANCLKSRC_t clksrc, uint32_t can_frequency)
339 {
340  uint32_t step_n, step_f;
341  bool normal_divider;
342  uint32_t freq_n, freq_f;
343  uint32_t step;
344  uint32_t can_frequency_khz;
345  uint32_t peripheral_frequency_khz;
346  XMC_CAN_DM_t can_divider_mode;
347 
348  uint32_t peripheral_frequency;
349  /*Enabling the module*/
350  XMC_CAN_Enable(obj);
351 
352  XMC_CAN_SetBaudrateClockSource(obj, clksrc);
353 
354  peripheral_frequency = XMC_CAN_GetBaudrateClockFrequency(obj);
355 
356  XMC_ASSERT("XMC_CAN_Init: frequency not supported", can_frequency <= peripheral_frequency);
357 
358  /* Normal divider mode */
359  step_n = (uint32_t)min(max(0U, (1024U - (peripheral_frequency / can_frequency))), 1023U);
360  freq_n = (uint32_t) (peripheral_frequency / (1024U - step_n));
361 
362  /* Fractional divider mode */
363  can_frequency_khz = (uint32_t) (can_frequency >> 6);
364  peripheral_frequency_khz = (uint32_t)(peripheral_frequency >> 6);
365 
366  step_f = (uint32_t)(min( (((1024U * can_frequency_khz) / peripheral_frequency_khz) ), 1023U ));
367  freq_f = (uint32_t)((peripheral_frequency_khz * step_f) / 1024U);
368  freq_f = freq_f << 6;
369 
370  normal_divider = (uint32_t)(can_frequency - freq_n) <= (can_frequency - freq_f);
371 
372  step = (normal_divider != 0U) ? step_n : step_f;
373  can_divider_mode = (normal_divider != 0U) ? XMC_CAN_DM_NORMAL : XMC_CAN_DM_FRACTIONAL;
374 
375  obj->FDR &= (uint32_t) ~(CAN_FDR_DM_Msk | CAN_FDR_STEP_Msk);
376  obj->FDR |= ((uint32_t)can_divider_mode << CAN_FDR_DM_Pos) | ((uint32_t)step << CAN_FDR_STEP_Pos);
377 
378 }
379 
380 #else
381 /* Initialization of XMC_CAN GLOBAL Object */
382 void XMC_CAN_Init(XMC_CAN_t *const obj, uint32_t can_frequency)
383 {
384  uint32_t step_n, step_f;
385  bool normal_divider;
386  uint32_t freq_n, freq_f;
387  uint32_t step;
388  uint32_t can_frequency_khz;
389  uint32_t peripheral_frequency_khz;
390  XMC_CAN_DM_t can_divider_mode;
391 
392  uint32_t peripheral_frequency = (XMC_SCU_CLOCK_GetPeripheralClockFrequency());
393 
394  XMC_ASSERT("XMC_CAN_Init: frequency not supported", can_frequency <= peripheral_frequency);
395 
396  /*Enabling the module*/
397  XMC_CAN_Enable(obj);
398 
399  /* Normal divider mode */
400  step_n = (uint32_t)min(max(0U, (1024U - (peripheral_frequency / can_frequency))), 1023U);
401  freq_n = (uint32_t) (peripheral_frequency / (1024U - step_n));
402 
403  /* Fractional divider mode */
404  can_frequency_khz = (uint32_t) (can_frequency >> 6);
405  peripheral_frequency_khz = (uint32_t)(peripheral_frequency >> 6);
406 
407  step_f = (uint32_t)(min( (((1024U * can_frequency_khz) / peripheral_frequency_khz) ), 1023U ));
408  freq_f = (uint32_t)((peripheral_frequency_khz * step_f) / 1024U);
409  freq_f = freq_f << 6;
410 
411  normal_divider = (uint32_t)(can_frequency - freq_n) <= (can_frequency - freq_f);
412 
413  step = (normal_divider != 0U) ? step_n : step_f;
414  can_divider_mode = (normal_divider != 0U) ? XMC_CAN_DM_NORMAL : XMC_CAN_DM_FRACTIONAL;
415 
416  obj->FDR &= (uint32_t) ~(CAN_FDR_DM_Msk | CAN_FDR_STEP_Msk);
417  obj->FDR |= ((uint32_t)can_divider_mode << CAN_FDR_DM_Pos) | ((uint32_t)step << CAN_FDR_STEP_Pos);
418 }
419 #endif
420 
421 void XMC_CAN_SetBaudrateClockSource(XMC_CAN_t *const obj,const XMC_CAN_CANCLKSRC_t source)
422 {
423 #if defined(MULTICAN_PLUS)
424  obj->MCR = (obj->MCR & ~CAN_MCR_CLKSEL_Msk) | source ;
425 #endif
426 }
427 
428 XMC_CAN_CANCLKSRC_t XMC_CAN_GetBaudrateClockSource(XMC_CAN_t *const obj)
429 {
430 #if defined(MULTICAN_PLUS)
431  return ((XMC_CAN_CANCLKSRC_t)((obj->MCR & CAN_MCR_CLKSEL_Msk) >> CAN_MCR_CLKSEL_Pos));
432 #elif (UC_FAMILY == XMC4)
433  return XMC_CAN_CANCLKSRC_FPERI;
434 #endif
435 }
436 
437 uint32_t XMC_CAN_GetBaudrateClockFrequency(XMC_CAN_t *const obj)
438 {
439  uint32_t frequency;
440 
441 #if defined(MULTICAN_PLUS)
442  switch(XMC_CAN_GetBaudrateClockSource(obj))
443  {
444 #if UC_FAMILY == XMC4
445  case XMC_CAN_CANCLKSRC_FPERI:
447  break;
448 #else
449  case XMC_CAN_CANCLKSRC_MCLK:
451  break;
452 #endif
453  case XMC_CAN_CANCLKSRC_FOHP:
454  frequency = OSCHP_GetFrequency();
455  break;
456 
457  default:
458  frequency = 0;
459  break;
460  }
461 #else
463 #endif
464 
465  return frequency;
466 }
467 
468 uint32_t XMC_CAN_InitEx(XMC_CAN_t *const obj, XMC_CAN_CANCLKSRC_t clksrc, uint32_t can_frequency)
469 {
470  uint32_t step_n;
471  uint32_t freq_n;
472  uint32_t peripheral_frequency;
473 
474  XMC_ASSERT("XMC_CAN_Init: frequency not supported", can_frequency <= peripheral_frequency);
475 
476  /*Enabling the module*/
477  XMC_CAN_Enable(obj);
478 
479  XMC_CAN_SetBaudrateClockSource(obj, clksrc);
480  peripheral_frequency = XMC_CAN_GetBaudrateClockFrequency(obj);
481 
482  /* Normal divider mode */
483  step_n = (uint32_t)min(max(0U, (1024U - (peripheral_frequency / can_frequency))), 1023U);
484  freq_n = (uint32_t)(peripheral_frequency / (1024U - step_n));
485 
486  obj->FDR &= (uint32_t) ~(CAN_FDR_DM_Msk | CAN_FDR_STEP_Msk);
487  obj->FDR |= ((uint32_t)XMC_CAN_DM_NORMAL << CAN_FDR_DM_Pos) | ((uint32_t)step_n << CAN_FDR_STEP_Pos);
488 
489  return freq_n;
490 }
491 
492 /* Sets the Identifier of the MO */
493 void XMC_CAN_MO_SetIdentifier(XMC_CAN_MO_t *const can_mo, const uint32_t can_identifier)
494 {
495  if ((can_mo->can_mo_ptr->MOAR & CAN_MO_MOAR_IDE_Msk) != (uint32_t)CAN_MO_MOAR_IDE_Msk)
496  {
497  can_mo->can_mo_ptr->MOAR = ((can_mo->can_mo_ptr->MOAR) & ~(uint32_t)(CAN_MO_MOAR_ID_Msk)) |
498  ((can_identifier << XMC_CAN_MO_MOAR_STDID_Pos) & (uint32_t)CAN_MO_MOAR_ID_Msk);
499  }
500  else
501  {
502  can_mo->can_mo_ptr->MOAR = ((can_mo->can_mo_ptr->MOAR) & ~(uint32_t)(CAN_MO_MOAR_ID_Msk)) |
503  (can_identifier & (uint32_t)CAN_MO_MOAR_ID_Msk);
504  }
505  can_mo->can_identifier = can_identifier;
506 }
507 
508 
509 /* Gets the Identifier of the MO */
510 uint32_t XMC_CAN_MO_GetIdentifier(const XMC_CAN_MO_t *const can_mo)
511 {
512  uint32_t identifier;
513  if ((can_mo->can_mo_ptr->MOAR & CAN_MO_MOAR_IDE_Msk) != (uint32_t)CAN_MO_MOAR_IDE_Msk)
514  {
515  identifier = ((can_mo->can_mo_ptr->MOAR) & (uint32_t)(CAN_MO_MOAR_ID_Msk)) >> XMC_CAN_MO_MOAR_STDID_Pos;
516  }
517  else
518  {
519  identifier = ((can_mo->can_mo_ptr->MOAR) & (uint32_t)(CAN_MO_MOAR_ID_Msk));
520  }
521  return identifier;
522 }
523 
524 /* Gets the acceptance mask for the CAN MO. */
525 uint32_t XMC_CAN_MO_GetAcceptanceMask(const XMC_CAN_MO_t *const can_mo)
526 {
527  uint32_t identifier_mask;
528  if (((can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_MIDE_Msk) != (uint32_t)CAN_MO_MOAMR_MIDE_Msk)
529  && ((can_mo->can_mo_ptr->MOAR & CAN_MO_MOAR_IDE_Msk) != (uint32_t)CAN_MO_MOAR_IDE_Msk))
530  {
531  identifier_mask = ((can_mo->can_mo_ptr->MOAMR) & (uint32_t)(CAN_MO_MOAMR_AM_Msk)) >> XMC_CAN_MO_MOAR_STDID_Pos;
532  }
533  else
534  {
535  identifier_mask = ((can_mo->can_mo_ptr->MOAMR) & (uint32_t)(CAN_MO_MOAMR_AM_Msk));
536  }
537  return identifier_mask;
538 }
539 
540 /* Gets the acceptance mask of the MO */
541 void XMC_CAN_MO_SetAcceptanceMask(XMC_CAN_MO_t *const can_mo,const uint32_t can_id_mask)
542 {
543  if (((can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_MIDE_Msk) != (uint32_t)CAN_MO_MOAMR_MIDE_Msk)
544  && ((can_mo->can_mo_ptr->MOAR & CAN_MO_MOAR_IDE_Msk) != (uint32_t)CAN_MO_MOAR_IDE_Msk))
545  {
546  can_mo->can_mo_ptr->MOAMR = ((can_mo->can_mo_ptr->MOAMR) & ~(uint32_t)(CAN_MO_MOAMR_AM_Msk)) |
547  (can_id_mask << XMC_CAN_MO_MOAR_STDID_Pos);
548  }
549  else
550  {
551  can_mo->can_mo_ptr->MOAMR = ((can_mo->can_mo_ptr->MOAMR) & ~(uint32_t)(CAN_MO_MOAMR_AM_Msk)) |
552  (can_id_mask & (uint32_t)CAN_MO_MOAMR_AM_Msk);
553  }
554  can_mo->can_id_mask = can_id_mask;
555 }
556 
557 /* Initialization of XMC_CAN MO Object */
558 void XMC_CAN_MO_Config(const XMC_CAN_MO_t *const can_mo)
559 {
560  uint32_t reg;
561 
562  /* Configure MPN */
563  uint32_t num = ((uint32_t)(can_mo->can_mo_ptr) - CAN_BASE - 0x1000U)/0x0020U;
564  uint32_t set = (((uint32_t)(num/32) << (CAN_MO_MOIPR_MPN_Pos + 5U)) | ((uint32_t)(num%32) << CAN_MO_MOIPR_MPN_Pos));
565  can_mo->can_mo_ptr->MOIPR &= ~(CAN_MO_MOIPR_MPN_Msk);
566  can_mo->can_mo_ptr->MOIPR |= set;
567 
568  if (((can_mo->can_id_mode != (uint32_t) XMC_CAN_FRAME_TYPE_STANDARD_11BITS) &&
569  (can_mo->can_id_mode != (uint32_t) XMC_CAN_FRAME_TYPE_EXTENDED_29BITS)) ||
570  ((can_mo->can_mo_type != XMC_CAN_MO_TYPE_RECMSGOBJ) &&
571  (can_mo->can_mo_type != XMC_CAN_MO_TYPE_TRANSMSGOBJ)))
572  {
573  ; /*Do nothing*/
574  }
575  else
576  {
577 
578  /* Disable Message object */
579  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk;
580  if (can_mo->can_id_mode == (uint32_t)XMC_CAN_FRAME_TYPE_STANDARD_11BITS)
581  {
582  reg = can_mo->mo_ar;
583  reg &= (uint32_t) ~(CAN_MO_MOAR_ID_Msk);
584  reg |= (can_mo->can_identifier << XMC_CAN_MO_MOAR_STDID_Pos);
585  can_mo->can_mo_ptr->MOAR = reg;
586 
587  reg = can_mo->mo_amr;
588  reg &= (uint32_t) ~(CAN_MO_MOAMR_AM_Msk);
589  reg |= (can_mo->can_id_mask << XMC_CAN_MO_MOAR_STDID_Pos);
590  can_mo->can_mo_ptr->MOAMR = reg;
591  }
592  else
593  {
594  can_mo->can_mo_ptr->MOAR = can_mo->mo_ar;
595  can_mo->can_mo_ptr->MOAMR = can_mo->mo_amr;
596  }
597  /* Check whether message object is transmit message object */
598  if (can_mo->can_mo_type == XMC_CAN_MO_TYPE_TRANSMSGOBJ)
599  {
600  /* Set MO as Transmit message object */
601  XMC_CAN_MO_UpdateData(can_mo);
602  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_SETDIR_Msk;
603 
604  /* Reset RTSEL and Set MSGVAL, TXEN0 and TXEN1 bits */
607  }
608  else
609  {
610  /* Set MO as Receive message object and set RXEN bit */
611  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_RESDIR_Msk;
612 
613  /* Reset RTSEL, TXEN1 and TXEN2 and Set MSGVAL and RXEN bits */
616  }
617 
618  }
619 }
620 
621 /* Update of XMC_CAN Object */
622 XMC_CAN_STATUS_t XMC_CAN_MO_UpdateData(const XMC_CAN_MO_t *const can_mo)
623 {
624  XMC_CAN_STATUS_t error = XMC_CAN_STATUS_MO_NOT_ACCEPTABLE;
625  /* Check whether message object is transmit message object */
626  if (can_mo->can_mo_type == XMC_CAN_MO_TYPE_TRANSMSGOBJ)
627  {
628  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_RESMSGVAL_Msk;
629  /* Configure data length */
630  can_mo->can_mo_ptr->MOFCR = ((can_mo->can_mo_ptr->MOFCR) & ~(uint32_t)(CAN_MO_MOFCR_DLC_Msk)) |
631  (((uint32_t) can_mo->can_data_length << CAN_MO_MOFCR_DLC_Pos) & (uint32_t)CAN_MO_MOFCR_DLC_Msk);
632  /* Configure Data registers*/
633  can_mo->can_mo_ptr->MODATAL = can_mo->can_data[0];
634  can_mo->can_mo_ptr->MODATAH = can_mo->can_data[1];
635  /* Reset RTSEL and Set MSGVAL ,TXEN0 and TXEN1 bits */
637  error = XMC_CAN_STATUS_SUCCESS;
638  }
639  else
640  {
641  error = XMC_CAN_STATUS_MO_NOT_ACCEPTABLE;
642  }
643  return error;
644 }
645 
646 /* This function is will put a transmit request to transmit message object */
647 XMC_CAN_STATUS_t XMC_CAN_MO_Transmit(const XMC_CAN_MO_t *const can_mo)
648 {
649  XMC_CAN_STATUS_t error = XMC_CAN_STATUS_ERROR;
650  uint32_t mo_type = (uint32_t)(((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_MSGVAL_Msk) >> CAN_MO_MOSTAT_MSGVAL_Pos);
651  uint32_t mo_transmission_ongoing = (uint32_t) ((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_TXRQ_Msk) >> CAN_MO_MOSTAT_TXRQ_Pos;
652  /* check if message is disabled */
653  if (mo_type == 0U)
654  {
655  error = XMC_CAN_STATUS_MO_DISABLED;
656  }
657  /* check if transmission is ongoing on message object */
658  else if (mo_transmission_ongoing == 1U)
659  {
660  error = XMC_CAN_STATUS_BUSY;
661  }
662  else
663  {
664  /* set TXRQ bit */
666  error = XMC_CAN_STATUS_SUCCESS;
667  }
668  return error;
669 }
670 
671 /* This function is will read the message object data bytes */
672 XMC_CAN_STATUS_t XMC_CAN_MO_ReceiveData (XMC_CAN_MO_t *can_mo)
673 {
674  XMC_CAN_STATUS_t error = XMC_CAN_STATUS_ERROR;
675  uint8_t rx_pnd = 0U;
676  uint8_t new_data = 0U;
677  uint32_t mo_type = (uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_DIR_Msk) >> CAN_MO_MOSTAT_DIR_Pos;
678  uint32_t mo_recepcion_ongoing = (uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_RXUPD_Msk) >> CAN_MO_MOSTAT_RXUPD_Pos;
679  /* check if message object is a receive message object */
680  if (mo_type != (uint32_t)XMC_CAN_MO_TYPE_RECMSGOBJ)
681  {
682  error = XMC_CAN_STATUS_MO_NOT_ACCEPTABLE;
683  }
684  /* check if reception is ongoing on message object */
685  else if (mo_recepcion_ongoing == 1U)
686  {
687  error = XMC_CAN_STATUS_BUSY;
688  }
689  else
690  {
691  /* read message parameters */
692  do
693  {
694  can_mo->can_data[0] = can_mo->can_mo_ptr->MODATAL;
695  can_mo->can_data[1] = can_mo->can_mo_ptr->MODATAH;
696 
697  rx_pnd = (uint8_t)((uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_RXUPD_Msk) >> CAN_MO_MOSTAT_RXUPD_Pos);
698  new_data = (uint8_t)((uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_NEWDAT_Msk) >> CAN_MO_MOSTAT_NEWDAT_Pos);
699  } while ((rx_pnd != 0U) && (new_data != 0U));
700 
701  error = XMC_CAN_STATUS_SUCCESS;
702  }
703  return error;
704 }
705 
706 
707 /* This function is will read the message object data bytes */
708 XMC_CAN_STATUS_t XMC_CAN_MO_Receive (XMC_CAN_MO_t *can_mo)
709 {
710  XMC_CAN_STATUS_t error = XMC_CAN_STATUS_ERROR;
711  uint8_t rx_pnd = 0U;
712  uint8_t new_data = 0U;
713  uint32_t mo_type = (uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_DIR_Msk) >> CAN_MO_MOSTAT_DIR_Pos;
714  uint32_t mo_recepcion_ongoing = (uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_RXUPD_Msk) >> CAN_MO_MOSTAT_RXUPD_Pos;
715  /* check if message object is a receive message object */
716  if (mo_type != (uint32_t)XMC_CAN_MO_TYPE_RECMSGOBJ)
717  {
718  error = XMC_CAN_STATUS_MO_NOT_ACCEPTABLE;
719  }
720  /* check if reception is ongoing on message object */
721  else if (mo_recepcion_ongoing == 1U)
722  {
723  error = XMC_CAN_STATUS_BUSY;
724  }
725  else
726  {
727  /* read message parameters */
728  do
729  {
730  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_RESNEWDAT_Msk;
731  if ((((can_mo->can_mo_ptr->MOAR) & CAN_MO_MOAR_IDE_Msk) >> CAN_MO_MOAR_IDE_Pos) == 0U)
732  {
733  can_mo->can_id_mode = (uint32_t)XMC_CAN_FRAME_TYPE_STANDARD_11BITS;
734  can_mo->can_identifier = (can_mo->can_mo_ptr->MOAR & XMC_CAN_MO_MOAR_STDID_Msk) >> XMC_CAN_MO_MOAR_STDID_Pos;
735  can_mo->can_ide_mask = (uint32_t)(can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_MIDE_Msk) >> CAN_MO_MOAMR_MIDE_Pos;
736  if(can_mo->can_ide_mask == 1U)
737  {
738  can_mo->can_id_mask = (uint32_t)(can_mo->can_mo_ptr->MOAMR & XMC_CAN_MO_MOAR_STDID_Msk) >> XMC_CAN_MO_MOAR_STDID_Pos;
739  }
740  else
741  {
742  can_mo->can_id_mask = (uint32_t)(can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_AM_Msk);
743  }
744  }
745  else
746  {
747  can_mo->can_id_mode = (uint32_t)XMC_CAN_FRAME_TYPE_EXTENDED_29BITS;
748  can_mo->can_identifier = (can_mo->can_mo_ptr->MOAR & CAN_MO_MOAR_ID_Msk);
749  can_mo->can_id_mask = (uint32_t)(can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_AM_Msk);
750  can_mo->can_ide_mask = (uint32_t)(can_mo->can_mo_ptr->MOAMR & CAN_MO_MOAMR_MIDE_Msk) >> CAN_MO_MOAMR_MIDE_Pos;
751  }
752  can_mo->can_data_length = (uint8_t)((uint32_t)((can_mo->can_mo_ptr->MOFCR) & CAN_MO_MOFCR_DLC_Msk) >> CAN_MO_MOFCR_DLC_Pos);
753 
754  can_mo->can_data[0] = can_mo->can_mo_ptr->MODATAL;
755  can_mo->can_data[1] = can_mo->can_mo_ptr->MODATAH;
756 
757  rx_pnd = (uint8_t)((uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_RXUPD_Msk) >> CAN_MO_MOSTAT_RXUPD_Pos);
758  new_data = (uint8_t)((uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_NEWDAT_Msk) >> CAN_MO_MOSTAT_NEWDAT_Pos);
759  } while ((rx_pnd != 0U) && (new_data != 0U));
760 
761  can_mo->can_mo_type = XMC_CAN_MO_TYPE_RECMSGOBJ;
762  error = XMC_CAN_STATUS_SUCCESS;
763  }
764  return error;
765 }
766 
767 /* Function to enable node event */
768 void XMC_CAN_NODE_EnableEvent(XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_EVENT_t event)
769 {
770  if(event != XMC_CAN_NODE_EVENT_CFCIE)
771  {
772  can_node->NCR |= (uint32_t)event;
773  }
774  else
775  {
776  can_node->NFCR |= (uint32_t)event;
777  }
778 }
779 
780 /* Function to disable node event */
781 void XMC_CAN_NODE_DisableEvent(XMC_CAN_NODE_t *const can_node, const XMC_CAN_NODE_EVENT_t event)
782 {
783  if(event != XMC_CAN_NODE_EVENT_CFCIE)
784  {
785  can_node->NCR &= ~(uint32_t)event;
786  }
787  else
788  {
789  can_node->NFCR &= ~(uint32_t)event;
790  }
791 }
792 /* Function to transmit MO from the FIFO */
793 XMC_CAN_STATUS_t XMC_CAN_TXFIFO_Transmit(const XMC_CAN_MO_t *const can_mo)
794 {
795  XMC_CAN_STATUS_t error = XMC_CAN_STATUS_ERROR;
796  uint32_t mo_type = ((uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_MSGVAL_Msk) >> CAN_MO_MOSTAT_MSGVAL_Pos);
797  uint32_t mo_transmission_ongoing = (uint32_t)((can_mo->can_mo_ptr->MOSTAT) & CAN_MO_MOSTAT_TXRQ_Msk) >> CAN_MO_MOSTAT_TXRQ_Pos;
798  uint32_t mo_cur = (uint32_t)(can_mo->can_mo_ptr-> MOFGPR & CAN_MO_MOFGPR_CUR_Msk) >> CAN_MO_MOFGPR_CUR_Pos;
799  CAN_MO_TypeDef* mo = (CAN_MO_TypeDef *)(CAN_BASE + 0x1000UL + (mo_cur * 0x0020UL));
800  /* check if message is disabled */
801  if (mo_type == 0U)
802  {
803  error = XMC_CAN_STATUS_MO_DISABLED;
804  }
805  /* check if transmission is ongoing on message object */
806  else if (mo_transmission_ongoing == 1U)
807  {
808  error = XMC_CAN_STATUS_BUSY;
809  }
810  else
811  {
813  error = XMC_CAN_STATUS_SUCCESS;
814  }
815  return error;
816 }
817 
818 /* Function to initialize the transmit FIFO MO base object */
819 void XMC_CAN_TXFIFO_ConfigMOBaseObject(const XMC_CAN_MO_t *const can_mo,const XMC_CAN_FIFO_CONFIG_t can_fifo)
820 {
821  can_mo->can_mo_ptr->MOFCR = ((can_mo->can_mo_ptr->MOFCR ) & ~(uint32_t)(CAN_MO_MOFCR_MMC_Msk)) |
822  (((uint32_t)0x2U << CAN_MO_MOFCR_MMC_Pos) & (uint32_t)CAN_MO_MOFCR_MMC_Msk);
823  can_mo->can_mo_ptr->MOFGPR = ((can_mo->can_mo_ptr->MOFGPR ) & ~(uint32_t)(CAN_MO_MOFGPR_BOT_Msk |
826  (((uint32_t)can_fifo.fifo_bottom << CAN_MO_MOFGPR_BOT_Pos) & (uint32_t)CAN_MO_MOFGPR_BOT_Msk) |
827  (((uint32_t)can_fifo.fifo_base << CAN_MO_MOFGPR_CUR_Pos) & (uint32_t) CAN_MO_MOFGPR_CUR_Msk) |
828  (((uint32_t)can_fifo.fifo_top << CAN_MO_MOFGPR_TOP_Pos) & (uint32_t) CAN_MO_MOFGPR_TOP_Msk);
829 }
830 /* Function to Initialize the receive FIFO MO base object */
831 void XMC_CAN_RXFIFO_ConfigMOBaseObject(const XMC_CAN_MO_t *const can_mo,const XMC_CAN_FIFO_CONFIG_t can_fifo)
832 {
833  can_mo->can_mo_ptr->MOFCR = ((can_mo->can_mo_ptr->MOFCR ) & ~(uint32_t)(CAN_MO_MOFCR_MMC_Msk)) |
834  (((uint32_t)0x1U << CAN_MO_MOFCR_MMC_Pos) & (uint32_t)CAN_MO_MOFCR_MMC_Msk);
835  can_mo->can_mo_ptr->MOFGPR = ((can_mo->can_mo_ptr->MOFGPR ) & ~( uint32_t)(CAN_MO_MOFGPR_BOT_Msk |
838  (((uint32_t)can_fifo.fifo_bottom << CAN_MO_MOFGPR_BOT_Pos) & (uint32_t)CAN_MO_MOFGPR_BOT_Msk) |
839  (((uint32_t)can_fifo.fifo_base << CAN_MO_MOFGPR_CUR_Pos) & (uint32_t)CAN_MO_MOFGPR_CUR_Msk) |
840  (((uint32_t)can_fifo.fifo_top << CAN_MO_MOFGPR_TOP_Pos) & (uint32_t)CAN_MO_MOFGPR_TOP_Msk);
841 }
842 
843 /* Function to Initialize the FIFO MO slave object */
844 void XMC_CAN_TXFIFO_ConfigMOSlaveObject(const XMC_CAN_MO_t *const can_mo,const XMC_CAN_FIFO_CONFIG_t can_fifo)
845 {
846  can_mo->can_mo_ptr->MOFCR = ((can_mo->can_mo_ptr->MOFCR ) & ~(uint32_t)(CAN_MO_MOFCR_MMC_Msk)) |
847  (((uint32_t)0x3U << CAN_MO_MOFCR_MMC_Pos) & (uint32_t)CAN_MO_MOFCR_MMC_Msk);
848  can_mo->can_mo_ptr->MOFGPR = ((can_mo->can_mo_ptr->MOFGPR ) & ~(uint32_t)(CAN_MO_MOFGPR_CUR_Msk)) |
849  (((uint32_t)can_fifo.fifo_base << CAN_MO_MOFGPR_CUR_Pos) & (uint32_t)CAN_MO_MOFGPR_CUR_Msk);
850 
851  can_mo->can_mo_ptr->MOCTR = CAN_MO_MOCTR_SETTXEN0_Msk|
853 }
854 
855 /* Function to Initialize the Gateway Source Object */
856 void XMC_CAN_GATEWAY_InitSourceObject(const XMC_CAN_MO_t *const can_mo,const XMC_CAN_GATEWAY_CONFIG_t can_gateway)
857 {
858  can_mo->can_mo_ptr->MOFCR = (((uint32_t)0x4U << CAN_MO_MOFCR_MMC_Pos) & (uint32_t)CAN_MO_MOFCR_MMC_Msk) |
859  ((((uint32_t)can_gateway.gateway_data_frame_send) << CAN_MO_MOFCR_GDFS_Pos) & (uint32_t)CAN_MO_MOFCR_GDFS_Msk) |
860  ((((uint32_t)can_gateway.gateway_data_length_code_copy) << CAN_MO_MOFCR_DLCC_Pos) & (uint32_t)CAN_MO_MOFCR_DLCC_Msk) |
861  ((((uint32_t)can_gateway.gateway_identifier_copy) << CAN_MO_MOFCR_IDC_Pos) & (uint32_t)CAN_MO_MOFCR_IDC_Msk) |
862  ((((uint32_t)can_gateway.gateway_data_copy) << CAN_MO_MOFCR_DATC_Pos) & (uint32_t)CAN_MO_MOFCR_DATC_Msk) ;
863  can_mo->can_mo_ptr->MOFGPR = (uint32_t)((((uint32_t)can_gateway.gateway_bottom << CAN_MO_MOFGPR_BOT_Pos) & (uint32_t)CAN_MO_MOFGPR_BOT_Msk) |
864  (((uint32_t)can_gateway.gateway_base << CAN_MO_MOFGPR_CUR_Pos) & (uint32_t)CAN_MO_MOFGPR_CUR_Msk) |
865  (((uint32_t)can_gateway.gateway_top << CAN_MO_MOFGPR_TOP_Pos) & (uint32_t)CAN_MO_MOFGPR_TOP_Msk));
866 }
867 
868 #endif /* XMC_CAN_H */
#define CAN_MO_MOSTAT_RXUPD_Msk
Definition: XMC1400.h:3954
#define CAN_FDR_STEP_Msk
Definition: XMC1400.h:3666
#define CAN_MO_MOFGPR_CUR_Pos
Definition: XMC1400.h:3849
#define CAN_MO_MOCTR_SETTXEN1_Msk
Definition: XMC1400.h:3944
#define CAN_MO_MOCTR_SETTXEN0_Msk
Definition: XMC1400.h:3942
uint32_t XMC_SCU_CLOCK_GetPeripheralClockFrequency(void)
Definition: xmc1_scu.c:792
#define CAN_MO_MOFCR_MMC_Msk
Definition: XMC1400.h:3816
#define CAN_MO_MOCTR_SETTXRQ_Msk
Definition: XMC1400.h:3940
#define CAN_NODE_NBTR_TSEG1_Msk
Definition: XMC1400.h:3778
#define CAN_MO_MOAR_IDE_Pos
Definition: XMC1400.h:3893
#define CAN_MO_MOFCR_DATC_Msk
Definition: XMC1400.h:3826
#define CAN_MO_MOCTR_SETRXEN_Msk
Definition: XMC1400.h:3938
#define CAN_MO_MOIPR_MPN_Pos
Definition: XMC1400.h:3859
void XMC_SCU_CLOCK_UngatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral)
Definition: xmc1_scu.c:636
#define CAN_FDR_STEP_Pos
Definition: XMC1400.h:3665
#define CAN_NODE_NBTR_DIV8_Pos
Definition: XMC1400.h:3781
#define CAN_MO_MOCTR_RESNEWDAT_Msk
Definition: XMC1400.h:3906
#define CAN_MO_MOAMR_MIDE_Msk
Definition: XMC1400.h:3868
#define CAN_MO_MOCTR_RESTXEN0_Msk
Definition: XMC1400.h:3918
#define CAN_NODE_NBTR_BRP_Msk
Definition: XMC1400.h:3774
#define CAN_MO_MOFGPR_BOT_Pos
Definition: XMC1400.h:3845
#define CAN_NODE_NBTR_TSEG2_Msk
Definition: XMC1400.h:3780
#define CAN_MO_MOAR_IDE_Msk
Definition: XMC1400.h:3894
#define CAN_MO_MOFCR_DLCC_Pos
Definition: XMC1400.h:3823
#define CAN_MO_MOFCR_GDFS_Pos
Definition: XMC1400.h:3819
#define CAN_MO_MOSTAT_RXUPD_Pos
Definition: XMC1400.h:3953
#define CAN_MO_MOIPR_MPN_Msk
Definition: XMC1400.h:3860
#define CAN_MO_MOCTR_RESDIR_Msk
Definition: XMC1400.h:3922
#define XMC_ASSERT(msg, exp)
Definition: xmc_common.h:132
#define CAN_MO_MOAMR_AM_Msk
Definition: XMC1400.h:3866
void XMC_SCU_CLOCK_GatePeripheralClock(const XMC_SCU_PERIPHERAL_CLOCK_t peripheral)
Definition: xmc1_scu.c:628
#define CAN_MO_MOCTR_RESTXEN1_Msk
Definition: XMC1400.h:3920
#define CAN_NODE_NBTR_DIV8_Msk
Definition: XMC1400.h:3782
#define CAN_NODE_NBTR_SJW_Msk
Definition: XMC1400.h:3776
#define CAN_MO_MOSTAT_TXRQ_Msk
Definition: XMC1400.h:3966
#define CAN_MO_MOFCR_IDC_Msk
Definition: XMC1400.h:3822
#define CAN_MO_MOFCR_DLCC_Msk
Definition: XMC1400.h:3824
#define CAN_MO_MOAMR_MIDE_Pos
Definition: XMC1400.h:3867
#define CAN_MO_MOCTR_RESRXEN_Msk
Definition: XMC1400.h:3914
#define CAN_MO_MOSTAT_TXRQ_Pos
Definition: XMC1400.h:3965
#define CAN_MO_MOFGPR_TOP_Msk
Definition: XMC1400.h:3848
#define CAN_MO_MOFCR_DLC_Msk
Definition: XMC1400.h:3842
#define CAN_MO_MOAR_ID_Msk
Definition: XMC1400.h:3892
#define CAN_NODE_NBTR_BRP_Pos
Definition: XMC1400.h:3773
#define CAN_MCR_CLKSEL_Pos
Definition: XMC1400.h:3705
#define CAN_BASE
Definition: XMC1400.h:8748
#define CAN_NODE_NBTR_SJW_Pos
Definition: XMC1400.h:3775
#define CAN_MO_MOSTAT_MSGVAL_Msk
Definition: XMC1400.h:3960
#define CAN_MO_MOSTAT_NEWDAT_Pos
Definition: XMC1400.h:3955
#define CAN_CLC_DISS_Msk
Definition: XMC1400.h:3652
__O uint32_t MOCTR
Definition: XMC1400.h:240
uint32_t OSCHP_GetFrequency(void)
Returns frequency of the high performace oscillator User needs to overload this function to return th...
#define CAN_MO_MOFGPR_TOP_Pos
Definition: XMC1400.h:3847
#define CAN_MO_MOCTR_SETMSGVAL_Msk
Definition: XMC1400.h:3934
#define CAN_MO_MOFCR_DLC_Pos
Definition: XMC1400.h:3841
#define CAN_NODE_NBTR_TSEG2_Pos
Definition: XMC1400.h:3779
#define CAN_FDR_DM_Msk
Definition: XMC1400.h:3668
#define CAN_MO_MOFGPR_BOT_Msk
Definition: XMC1400.h:3846
#define __STATIC_INLINE
Definition: cmsis_gcc.h:47
#define CAN_MO_MOFCR_GDFS_Msk
Definition: XMC1400.h:3820
#define CAN_CLC_DISR_Msk
Definition: XMC1400.h:3650
#define CAN_MO_MOFCR_MMC_Pos
Definition: XMC1400.h:3815
#define CAN_MO_MOSTAT_MSGVAL_Pos
Definition: XMC1400.h:3959
#define CAN_MO_MOCTR_RESRTSEL_Msk
Definition: XMC1400.h:3912
#define CAN_FDR_DM_Pos
Definition: XMC1400.h:3667
#define CAN_MO_MOSTAT_DIR_Pos
Definition: XMC1400.h:3971
#define CAN_MO_MOCTR_SETDIR_Msk
Definition: XMC1400.h:3946
#define CAN_MO_MOCTR_RESMSGVAL_Msk
Definition: XMC1400.h:3910
#define CAN_MO_MOFCR_IDC_Pos
Definition: XMC1400.h:3821
#define CAN_MO_MOFCR_DATC_Pos
Definition: XMC1400.h:3825
#define CAN_MCR_CLKSEL_Msk
Definition: XMC1400.h:3706
#define CAN_MO_MOSTAT_NEWDAT_Msk
Definition: XMC1400.h:3956
#define CAN_MO_MOSTAT_DIR_Msk
Definition: XMC1400.h:3972
#define CAN_MO_MOCTR_SETNEWDAT_Msk
Definition: XMC1400.h:3930
#define CAN_NODE_NBTR_TSEG1_Pos
Definition: XMC1400.h:3777
#define CAN_MO_MOFGPR_CUR_Msk
Definition: XMC1400.h:3850